package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.TeacherLeaveMapper;
import com.ruoyi.teach.domain.TeacherLeave;
import com.ruoyi.teach.service.ITeacherLeaveService;

/**
 * 请假管理Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-23
 */
@Service
public class TeacherLeaveServiceImpl implements ITeacherLeaveService
{
    @Autowired
    private TeacherLeaveMapper teacherLeaveMapper;

    /**
     * 查询请假管理
     *
     * @param leaveId 请假管理主键
     * @return 请假管理
     */
    @Override
    public TeacherLeave selectTeacherLeaveByLeaveId(Long leaveId)
    {
        return teacherLeaveMapper.selectTeacherLeaveByLeaveId(leaveId);
    }

    /**
     * 查询请假管理列表
     *
     * @param teacherLeave 请假管理
     * @return 请假管理
     */
    @Override
    public List<TeacherLeave> selectTeacherLeaveList(TeacherLeave teacherLeave)
    {
        return teacherLeaveMapper.selectTeacherLeaveList(teacherLeave);
    }

    /**
     * 新增请假管理
     *
     * @param teacherLeave 请假管理
     * @return 结果
     */
    @Override
    public int insertTeacherLeave(TeacherLeave teacherLeave)
    {
        teacherLeave.setCreateTime(DateUtils.getNowDate());
        return teacherLeaveMapper.insertTeacherLeave(teacherLeave);
    }

    /**
     * 修改请假管理
     *
     * @param teacherLeave 请假管理
     * @return 结果
     */
    @Override
    public int updateTeacherLeave(TeacherLeave teacherLeave)
    {
        teacherLeave.setUpdateTime(DateUtils.getNowDate());
        return teacherLeaveMapper.updateTeacherLeave(teacherLeave);
    }

    /**
     * 批量删除请假管理
     *
     * @param leaveIds 需要删除的请假管理主键
     * @return 结果
     */
    @Override
    public int deleteTeacherLeaveByLeaveIds(Long[] leaveIds)
    {
        return teacherLeaveMapper.deleteTeacherLeaveByLeaveIds(leaveIds);
    }

    /**
     * 删除请假管理信息
     *
     * @param leaveId 请假管理主键
     * @return 结果
     */
    @Override
    public int deleteTeacherLeaveByLeaveId(Long leaveId)
    {
        return teacherLeaveMapper.deleteTeacherLeaveByLeaveId(leaveId);
    }
}
